export default {
    install: (app: {
            directive: (arg0: string, arg1: {
                //@ts-ignore
                mounted(el: any, binding: any): void
            }) => void
        }) => {
        app.directive('lazyLoad', {
            //@ts-ignore
            mounted(el, binding) {
                const io = new IntersectionObserver(entries => {
                    if (entries[0].isIntersecting) {
                        el.src = binding.value
                        io.unobserve(el)
                    }
                })
                io.observe(el)
            },

        })

    }
}